xe2x80x9cA system for and a method of protection against stack overflow in a memory and a franking machine employing themxe2x80x9d
The present invention relates to a system for and a method of protection against stack overflow in a memory and a franking machine employing them.
It applies in particular to franking machines provided with a program executing in a multitasking environment and more generally to protecting sensitive data.
In a franking machine, some tasks use amounts representing sums of money. Correct execution of each of these tasks of a program must be guaranteed. Correct execution means that a task executes in its stack. The stack of a task corresponds to a memory space that is reserved for it. In other words, the invention aims to prevent sensitive data being degraded or modified inopportunely. It is therefore essential to guarantee that no stack overflows outside the memory space that is allocated to it.
There is no certification of no stack overflow of a task in prior art multitasking programs using electronic memories.
To this end, the present invention aims to place the stack including the most sensitive data in the most upstream position in the memory space used for the stacks of the tasks, relative to the direction of movement of a pointer in a stack.
Accordingly, even if another stack overflows, its pointer cannot reach the stack that contains the most sensitive data.
A first aspect of the invention provides a method of protecting sensitive data against overflow of a stack, i.e. of a memory space reserved for a part of a program, characterized in that it includes an operation of allocating stack to each program part, during which operation the most upstream stack, relative to the direction of movement of the pointer in a stack, is allocated to a task operating on said sensitive data.
Accordingly, if another stack overflows, it is in the upstream to downstream direction that data can be disturbed, with no risk of disturbance of the sensitive data.
In particular, the sensitive data can represent sums of money.
According to particular features, said method includes the execution of a single task operating on said sensitive data.
A second aspect of the invention provides a device for protecting sensitive data against overflow of a stack, i.e. of a memory space reserved for a part of a program, characterized in that it includes means for allocating stack to each program part adapted to allocate the most upstream stack, relative to the direction of movement of a pointer in a stack, to a task operating on said sensitive data.
The invention also provides a franking machine characterized in that it includes a device as succinctly described hereinabove.
The invention also provides:
means for storing information readable by a computer or a microprocessor storing instructions of a computer program, characterized in that it enables to implement the method according to the invention as succinctly described hereinabove, and
partly or completely removable means for storing information readable by a computer or a microprocessor storing instructions of a computer program, characterized in that it enables to implement the method according to the invention as succinctly described hereinabove.